package com.copera.cn.kaka;

import com.copera.cn.kaka.util.ActivityManager;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.RadioGroup;
import android.widget.TabHost;
import android.widget.RadioGroup.OnCheckedChangeListener;

/**
 * 
 * @Description: 我的店铺-兑换
 *
 * @author lyc
 *
 * @date 2014年7月10日
 */
@SuppressWarnings("deprecation")
public class MyShopTableHostActivity extends TabActivity{

	private TabHost tabHost;
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ActivityManager.getInstance().push(this);
		setContentView(R.layout.activity_myshop_track_tablehost);
		
		tabHost=this.getTabHost();
        TabHost.TabSpec spec;
        Intent intent;

        intent=new Intent().setClass(this, MyShopExchangeActivity.class);
        spec=tabHost.newTabSpec("今天").setIndicator("今天").setContent(intent);
        tabHost.addTab(spec);
        
        intent=new Intent().setClass(this,MyShopExchangeOldActivity.class);
        spec=tabHost.newTabSpec("最近3天").setIndicator("最近3天").setContent(intent);
        tabHost.addTab(spec);
        
        tabHost.setCurrentTab(0);
        
        RadioGroup radioGroup=(RadioGroup) this.findViewById(R.id.main_tab_group);
        radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			
			@Override
			public void onCheckedChanged(RadioGroup group, int checkedId) {
				switch (checkedId) {
				case R.id.main_tab_addExam:
					tabHost.setCurrentTabByTag("今天");
					break;
				case R.id.main_tab_myExam:
					tabHost.setCurrentTabByTag("最近3天");
					break;
				default:
					tabHost.setCurrentTabByTag("今天");
					break;
				}
			}
		});
	}
}
